package com.ringtheweb.serviceprovider.weather.model;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import com.ringtheweb.model.Play;


@Entity
@Table(name="WEATHER_PLAY")
@DiscriminatorValue("WEATHER")
@PrimaryKeyJoinColumn(name = "WEATHER_ID",
                      referencedColumnName = "PLAY_ID")
public class WeatherPlay extends Play {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1L;
	
	
	/** Location */
	@ManyToOne
	@JoinColumn(name="LOCATION_ID")
	private Location location;
	
	@Column(name="TEMP_UNIT")
	@Enumerated(EnumType.ORDINAL)
	private TemperatureUnit tempUnit;

	public TemperatureUnit getTempUnit() {
		return tempUnit;
	}

	public void setTempUnit(TemperatureUnit tempUnit) {
		this.tempUnit = tempUnit;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

}
